import React, { useState } from 'react';

import LoginRegisCommonBg from '@/components/LoginRegisCommonBg';
import QrCodePage from '@/components/QrCodePage';
import RegisterForm from '@/pages/Register/RegisterForm';
const Register: React.FC = () => {
  const [isQrcode, setQrcode] = useState(1);
  const switchTabPage = (is: number) => {
    setQrcode(is);
  };
  const switchPage = () => {
    switch (isQrcode) {
      case 0:
        return (
          <QrCodePage
            qrcodeUrl={
              'https://hbimg.huabanimg.com/f26f5ed0d000c3413c9a4250f2c22bcb86a9494e2b2a-Gw0bYT_fw658/format/webp'
            }
            switchTabPage={switchTabPage}
          />
        );
      default:
        return <RegisterForm switchTabPage={switchTabPage} />;
    }
  };
  return <LoginRegisCommonBg>{switchPage()}</LoginRegisCommonBg>;
};
export default Register;
